import { useInitDataSingleton } from './shared';
import { BasConfigApi, BasConfigAllOutput } from '/@/api/bas/BasConfig';

const { list, initList: initBasConfigList } = useInitDataSingleton<BasConfigAllOutput>(BasConfigApi.all);

// 必须在登录后初始化
export { initBasConfigList };

// 获取参数值
export const getConfigValue = (code: string) => {
	var obj = list.value.find((item) => item.code.toLowerCase() == code.toLowerCase());
	return obj?.value;
};
